<?php
 
include_once '../clases/Pendientes.php';

    $tc = $_REQUEST['tc'];
    
    if($tc == 1){
        $entregat = $_REQUEST['oidt'];
        $paciente = $_REQUEST['pac'];
        $tramite = utf8_decode($_REQUEST['pendi']);
        //$fecha = $_REQUEST['fec'];
        
       // $fechatra = date('Y-m-d H:i:s',strtotime($fecha));
        
        $datos = new Pendientes($entregat, $paciente, $tramite,"", "", "");
        $datos->guardarT();
    }if($tc == 2){
        
        $entregat = $_REQUEST['oidt'];
        $paciente = $_REQUEST['pac'];
        
        $datos = new Pendientes($entregat, $paciente, "", "", "", "");
        $datos->consultarP();        
    }if($tc == 3){
        
        $oid = $_REQUEST['oid'];
        $pen = utf8_decode($_REQUEST['pen']);
        $fecha = $_REQUEST['fec'];
        
        $fec = date('Y-m-d H:i:s',strtotime($fecha));
        
        $datos = new Pendientes("", "", "", "", "", "");
        $datos->editarT($oid,$pen,$fec);
    }
    if($tc == 4){
        $oid = $_REQUEST['oid'];
        $fechatra = $_REQUEST['fecha'];
        
        $datos = new Pendientes("", "", "", "", "", "");
        $datos->cumplido($oid,$fechatra);
    }
    if($tc == 5){
        
        $pac = $_REQUEST['pac'];
        $ingre = $_REQUEST['ingre'];
        $oidt = $_REQUEST['oidt'];
        
        $datos = new Pendientes("", "", "", "", "", "");
        $datos->pedientesI($pac,$ingre);
    }
?>
